/*
 * TextureManager.cpp
 *
 *  Created on: 6 janv. 2013
 *      Author: johan
 */

#include <algorithm>

#include "TextureManager.h"
#include "Texture.h"


using namespace std;

namespace ge {

	TextureManager::TextureManager()
	{
		cout << "texMan created" << endl;
	}

	void TextureManager::addTexture(Texture* t) {
		textures.push_back(t);
	}

	void TextureManager::removeTexture(Texture* t) {
		textures.remove(t);
	}

	void TextureManager::loadAll() {
		size_t n = textures.size();
		size_t current = 0;
		for (Texture* t : textures) {
			current++;
			cout << "texMan loading [" << current << "/" << n << "]..." << endl;
			t->load();
		}
	}

	TextureManager::~TextureManager()
	{
		cout << "texMan is dying" << endl;
	}

} /* namespace ge */
